//<editor-fold desc="node core modules">
var path = require('path');
//</editor-fold>

//<editor-fold desc="npm module">
var expect = require('expect.js');
var _ = require('underscore');
var exec = require('child_process').exec;
require('shelljs/global');

var NL = require('nllib');
//</editor-fold>

describe.only('subtree-test', function () {
    it('test.sh 01', function (done) {
        exec('bash test.sh 01', function (err, stdout, stderr) {
            // NL.lformat('stdout---begin');
            // NL.lformat(stdout);
            // NL.lformat('stdout---end');

            var src = './subtree-test/test-01/test-02/333.txt';
            var flag = test('-e', src);

            NL.lformat('{0} exists ===> {1}', src, flag);

            expect(flag).to.eql(false);
            done();
        });
    });

    it('test.sh 02', function (done) {
        exec('bash test.sh 02', function (err, stdout, stderr) {
            // NL.lformat('stdout---begin');
            // NL.lformat(stdout);
            // NL.lformat('stdout---end');

            var src = './subtree-test/test-01/test-02/333.txt';
            var flag = test('-e', src);

            NL.lformat('{0} exists ===> {1}', src, flag);

            expect(flag).to.eql(true);
            done();
        });
    });

    it('test.sh 03', function (done) {
        exec('bash test.sh 03', function (err, stdout, stderr) {
            // NL.lformat('stdout---begin');
            // NL.lformat(stdout);
            // NL.lformat('stdout---end');

            var src = './subtree-test/test-02/333.txt';
            var flag = test('-e', src);

            NL.lformat('{0} exists ===> {1}', src, flag);

            expect(flag).to.eql(false);
            done();
        });
    });

    it('test.sh 04', function (done) {
        exec('bash test.sh 04', function (err, stdout, stderr) {
            // NL.lformat('stdout---begin');
            // NL.lformat(stdout);
            // NL.lformat('stdout---end');

            var src = './subtree-test/test-02/333.txt';
            var flag = test('-e', src);

            NL.lformat('{0} exists ===> {1}', src, flag);

            expect(flag).to.eql(true);
            done();
        });
    });

    it('test.sh 05', function (done) {
        exec('bash test.sh 05', function (err, stdout, stderr) {
            // NL.lformat('stdout---begin');
            // NL.lformat(stdout);
            // NL.lformat('stdout---end');

            var src = './subtree-test/test-01-new-git-clone/test-02/333.txt';
            var flag = test('-e', src);

            NL.lformat('{0} exists ===> {1}', src, flag);

            expect(flag).to.eql(true);
            done();
        });
    });

    it('test.sh 06', function (done) {
        exec('bash test.sh 06', function (err, stdout, stderr) {
            // NL.lformat('stdout---begin');
            // NL.lformat(stdout);
            // NL.lformat('stdout---end');

            var src = './subtree-test/test0-01-new-git-clone/test-02/333.txt';
            var flag = test('-e', src);

            NL.lformat('{0} exists ===> {1}', src, flag);

            expect(flag).to.eql(true);
            done();
        });
    });

});




